package com.yinhe.music.yhmusic.adapter;

import com.chad.library.adapter.base.BaseSectionQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yinhe.music.yhmusic.R;
import com.yinhe.music.yhmusic.main.home.SongClassifySection;

import java.util.List;

public class SongClassifyAdapter extends BaseSectionQuickAdapter<SongClassifySection, BaseViewHolder> {
    /**
     * Same as QuickAdapter#QuickAdapter(Context,int) but with
     * some initialization data.
     *
     * @param data A new list is created out of this one to avoid mutable list
     */
    public SongClassifyAdapter(List<SongClassifySection> data) {
        super(R.layout.item_song_menu_classify, R.layout.comment_item_header, data);
    }

    @Override
    protected void convertHead(BaseViewHolder helper, SongClassifySection item) {
        helper.setText(R.id.header_text, item.header);
    }

    /**
     * Implement this method and use the helper to adapt the view to the given item.
     *
     * @param helper A fully initialized helper.
     * @param item   The item that needs to be displayed.
     */
    @Override
    protected void convert(BaseViewHolder helper, SongClassifySection item) {
        helper.setText(R.id.tv, item.t);
    }
}
